package com.ruoyi.erp.service.Impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.ErpCustomerMapper;
import com.ruoyi.erp.domain.ErpCustomer;
import com.ruoyi.erp.service.IErpCustomerService;

/**
 * 客户信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-20
 */
@Service
public class ErpCustomerServiceImpl implements IErpCustomerService
{
    @Autowired
    private ErpCustomerMapper erpCustomerMapper;

    /**
     * 查询客户信息
     *
     * @param id 客户信息主键
     * @return 客户信息
     */
    @Override
    public ErpCustomer selectErpCustomerById(Long id)
    {
        return erpCustomerMapper.selectErpCustomerById(id);
    }

    /**
     * 查询客户信息列表
     *
     * @param erpCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<ErpCustomer> selectErpCustomerList(ErpCustomer erpCustomer)
    {
        return erpCustomerMapper.selectErpCustomerList(erpCustomer);
    }

    /**
     * 新增客户信息
     *
     * @param erpCustomer 客户信息
     * @return 结果
     */
    @Override
    public int insertErpCustomer(ErpCustomer erpCustomer)
    {
        erpCustomer.setCreateTime(DateUtils.getNowDate());
        return erpCustomerMapper.insertErpCustomer(erpCustomer);
    }

    /**
     * 修改客户信息
     *
     * @param erpCustomer 客户信息
     * @return 结果
     */
    @Override
    public int updateErpCustomer(ErpCustomer erpCustomer)
    {
        return erpCustomerMapper.updateErpCustomer(erpCustomer);
    }

    /**
     * 批量删除客户信息
     *
     * @param ids 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteErpCustomerByIds(Long[] ids)
    {
        return erpCustomerMapper.deleteErpCustomerByIds(ids);
    }

    /**
     * 删除客户信息信息
     *
     * @param id 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteErpCustomerById(Long id)
    {
        return erpCustomerMapper.deleteErpCustomerById(id);
    }
}

